package com.wuyou.simple;

/**
 * 2347. 最好的扑克手牌
 */

public class BestHand {




    public String sol_1(int[] ranks, char[] suits){
        String[] resArr = {"Flush", "Three of a Kind", "Pair", "High Card"};
        int maxKind = 0, maxColor = 0;
        int[] kindArr = new int[14];
        int[] colorArr = new int[24];
        for (int i = 0; i < ranks.length; i++) {
            kindArr[ranks[i]] ++;
            maxKind = Math.max(kindArr[ranks[i]], maxKind);
            colorArr[suits[i] - 'a'] ++;
            maxColor = Math.max(colorArr[suits[i] - 'a'], maxColor);
        }
        if(maxColor == 5){
            return resArr[0];
        } else if (maxKind >= 3) {
            return resArr[1];
        } else if (maxKind == 2) {
            return resArr[2];
        }else {
            return resArr[3];
        }
    }
}
